<?php $this->load->view('admin/public/head.html', array('css' => array(
    '/assets/admin/css/admin/common.css'
))); ?>
<!-- Content Wrapper. Contains page content -->
<div class="content-wrapper admin-user-list" ng-controller="admin-purchaser-user-index">
    <!-- Content Header (Page header) -->
    <section class="content-header">
        <h1>
            采购商管理
            <small>采购商会员列表</small>
        </h1>
        <ol class="breadcrumb">
            <li><a href="#"><i class="fa fa-dashboard"></i>后台首页</a></li>
            <li class="active">采购商列表</li>
        </ol>
    </section>

    <!-- Main content -->
    <section class="content">

        <div class="row">

            <div class="col-md-12">
                <div class="nav-tabs-custom">
                    <ul class="nav nav-tabs">
                        <li ng-class="{'active': -1 == <?=$status?>}">
                            <a href="<?=base_url('/user/purchaser/index?status=-1')?>">全部采购商</a>
                        </li>
                        <li ng-class="{'active': 6 == <?=$status?>}">
                            <a href="<?=base_url('/user/purchaser/index?status=6')?>">已审核</a>
                        </li>
                        <li ng-class="{'active': 0 == <?=$status?>}">
                            <a href="<?=base_url('/user/purchaser/index?status=0')?>">待审核</a>
                        </li>
                        <li ng-class="{'active': 5 == <?=$status?>}">
                            <a href="<?=base_url('/user/purchaser/index?status=5')?>">未通过</a>
                        </li>
                    </ul>
                    <div class="tab-content">
                        <div class="active tab-pane" id="activity">
                            <div class="box">
                                <!-- /.box-header -->
                                <div class="box-body">
                                    <table class="table table-bordered purchaser-table">
                                        <tr>
                                            <th class="text-center" style="width: 40px">#</th>
                                            <th class="text-center" style="width: 50px">头像</th>
                                            <th>姓名</th>
                                            <th class="text-center">手机</th>
                                            <th class="text-center">微信</th>
                                            <th class="text-center">邮箱</th>
                                            <th class="text-center">单位</th>
                                            <th class="text-center">营业执照</th>
                                            <th class="text-center">组织机构</th>
                                            <th class="text-center">申请时间</th>
                                            <th class="text-center">状态</th>
                                            <th class="text-center" style="width: 90px">查看</th>
                                        </tr>

                                        <?php if (!empty($lists) && is_array($lists)): ?>
                                        <?php foreach($lists as $list):?>
                                        <tr>
                                            <td class="text-center"><?=$list['id']?></td>
                                            <td class="text-center">
                                                <img src="<?=$list['avatar']?>" style="width: 40px; height: 40px;" alt="">
                                            </td>
                                            <td><a href="/user/detail/index?id=<?=$list['id']?>"><?=$list['name']?></a></td>
                                            <td class="text-center">
                                                <?=$list['phone'] ? $list['phone'] : '--'?>
                                            </td>
                                            <td class="text-center"><?= $list['wechat']?></td>
                                            <td class="text-center"><?= $list['email']?></td>
                                            <td class="text-center"><?= $list['company']?></td>
                                            <td class="text-center">
                                                <img src="<?=$list['license_url']?>" style="cursor: zoom-in;" ng-click="showImage('<?=$list['license']?>')" alt="">
                                            </td>
                                            <td class="text-center">
                                                <img src="<?=$list['organization_url']?>" style="cursor: zoom-in;" ng-click="showImage('<?=$list['organization']?>')" alt="">
                                            <td class="text-center"><?= $list['created_time']?></td>
                                            <td class="text-center" id="item-<?=$list['id']?>">
                                                <?php
                                                    switch($list['status']){
                                                    case 0:
                                                        echo '<span class="text-aqua">待审</td>';
                                                        break;
                                                    case 6:
                                                        echo '<span class="text-success">通过</span>';
                                                        break;
                                                    case 5:
                                                        echo '<span class="text-danger">拒绝</span>';
                                                        break;
                                                    }
                                                ?>
                                            </td>
                                            <td class="text-center">
                                                <a class="btn btn-link btn-flat btn-xs" href="/user/detail/index?id=<?=$list['userid']?>"><i class="fa fa-search"></i> 查看</a>
                                                <a class="btn btn-link btn-flat btn-xs" href="javascript:void(0);" ng-click="alert(<?=$list['id']?>)"><i class="fa fa-cog"></i> 审核</a>
                                            </td>
                                        </tr>
                                        <?php endforeach;?>
                                        <?php else: ?>
                                        <tr>
                                            <td colspan="10"><p class="text-center help-block">暂无数据</p></td>
                                        </tr>
                                        <?php endif;?>
                                    </table>
                                    <?=$page?>
                                </div>
                            </div>
                        </div>
                    </div>
                    <!-- /.tab-content -->
                </div>
            </div>

        </div>

    </section>
    <!-- /.content -->

    <div class="modal" id="imageModal">
        <div class="modal-dialog">
            <div class="modal-content">
                <div class="row">
                    <div class="col-md-12">
                        <div class="box box-solid">
                            <div class="box-header with-border">
                                <h3 class="box-title">显示证件</h3>
                            </div>
                            <div class="box-body">
                                <img ng-src="{{ imgUrl }}" style="width: 100%;" alt="">
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>

<?php $this->load->view('admin/public/foot.html', array('js' => array(
'/assets/admin/js/user/index.js'
))); ?>

